// 不需要鉴权的业务路由
import { RouteRecordRaw } from 'vue-router'

const commonRoutes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/auth-login/:autoLogin?/:authToken?',
    name: 'AuthLogin',
    component: () => import('@/views/AuthLogin/AuthLogin.vue'),
    meta: {
      titleSub: '授权登录',
      cache: false
    }
  },
  {
    path: '/',
    name: '',
    redirect: '/postMessage',
    component: () => import('@/layout/layout.vue'),
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import('@/views/Home/Home.vue'),
        meta: {
          titleSub: '首页',
          cache: false
        }
      }
    ]
  },
  {
    path: '/postMessage/:type?',
    name: 'postMessage',
    component: () => import('@/views/postMessage/index.vue'),
    meta: {
      title: '屏幕通讯postMessage',
      cache: false
    }
  },
  {
    path: '/sort',
    name: 'sort',
    component: () => import('@/views/sortAggregate/index.vue'),
    meta: {
      title: '排序',
      cache: false
    }
  }
]

export default commonRoutes
